
#import "AppDelegate.h"
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    if ([FAMStaticTool FAM_getUserDefaultsValue:kIsFirst]) {
        self.window.rootViewController = [FAMTabBarViewController new];
    }else{
        self.window.rootViewController = [[FAMNavigationViewController alloc]initWithRootViewController:[FAMGenderViewController new]];
    }
    [[FAMNetHeaderConfig shared] FAM_setupConfigWithAppId:[FAMTool FAM_getAppId] appkey:[FAMTool FAM_getAppKey]];
    [self.window makeKeyAndVisible];
    [self FAM_Store];
    return YES;
}
- (void)FAM_Store{
    
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
    ASIdentifierManager *manager = [ASIdentifierManager sharedManager];
    if (@available(iOS 14, *)) {
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            switch (status) {
                case ATTrackingManagerAuthorizationStatusAuthorized:
//                    NSLog(@"%@",manager.advertisingIdentifier);
                    break;
                    
                default:
                    break;
            }
        }];
    } else {
        if (manager.isAccessibilityElement) {
//            NSLog(@"%@",manager.advertisingIdentifier.UUIDString);
        }
    }
}
@end
